import req  from '@/utils/request';


enum API {
    upload_image = '/oss/upload',
}

export const uploadImageApi = (file: File, path: string) => {
    const formData = new FormData();
    formData.append('file', file);
    formData.append('path', path);
    // headers 添加 content-type 为 multipart/form-data
    // req.defaults.headers.post['Content-Type'] = 'multipart/form-data';
    // 发送请求
    return req.post(API.upload_image, formData, { headers: { 'Content-Type': 'multipart/form-data' } });
}



 